By scanning through the elements of the array, updating a provisional maximum until all elements have been examined. This is the algorithm used in the previous chapter.
The program shows a partial definition of the ArrayOps
class.
The ArrayOps
class contains a method findMax()
that
finds the maximum of an array.
The parameter list is of the method is: int[] x
x
which will be a
reference to an array object.x
to
stand for the actual array it will work with.
The parameter x
means
"whatever data is supplied each time the method
is run."
This may be different for different runs.
Fill in the blank so that the method is complete.